/**
 * Common.js
 */
//渲染器
var Common = {
	formatDate : function(time){
		var now = new Date(time);     
		var year=now.getFullYear();
        var month=now.getMonth()+1;
        if(month<10)
        	month="0"+month;
        var date=now.getDate();
        if(date<10)
        	date="0"+date;
        var hour=now.getHours();
        var minute=now.getMinutes(); 
        var second=now.getSeconds();
        return year+"-"+month+"-"+date+" "+hour+":"+minute+":"+second;   
	},

	getUrlParam : function(name){
		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
	    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
	    if (r != null) return unescape(r[2]); return null; //返回参数值
	}
};
